<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>CMS信息管理</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/layui/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">CMS管理系統</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <%-- onerror 是当 src 属性访问不到时 触发的事件 --%>
                    <img id="loginImg"
                         onerror="javascript:this.src='${pageContext.request.contextPath}/imgs/default.jpg'"
                         src="${pageContext.request.contextPath}/${user.img}" class="layui-nav-img">
                    ${user.realname}
                </a>
            </li>
            <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/user.do?service=logOut">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">基础信息管理</a>
                    <dl class="layui-nav-child">
                        <c:if test="${user.role == 1}">
                            <dd><a href="${pageContext.request.contextPath}/page.do?service=userList" target="content">员工管理</a>
                            </dd>
                        </c:if>
                        <dd><a href="${pageContext.request.contextPath}/page.do?service=customerList" target="content" target="content">客户管理</a></dd>
                    </dl>

                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">系统管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="${pageContext.request.contextPath}/page.do?service=modify"
                               target="content">修改密码</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/page.do?service=updateImg"
                               target="content">修改头像</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;height: 100%">
            <iframe name="content" width="100%" height="100%" style="border: 0px" src="http://nows.fun/"></iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © 武汉尚学堂-Java1012
    </div>
</div>
<script src="${pageContext.request.contextPath}/resources/layui/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;

    });
</script>
</body>
</html>
